export default {
  namespaced: true,
  state: {
    //   用户信息
    userInfo:
      {
        aid: null,
        cid: null,
        uuid: '',
        add_time: null,
        stain_time: null,
        is_del: null,
        eid: '' || uni.getStorageSync('userInfo').eid,
      } || uni.getStorageSync('userInfo'),
    eid: '' || uni.getStorageSync('userInfo').eid,
    defaultParams: {
      aid: 11,
      appName: '清风好剧',
      version: '1.0.9',
      versionCode: 1,
      timestamp: Date.now(),
      channel_id: uni.getLaunchOptionsSync().query.channel_id || 0,
      plan_id: uni.getStorageSync('plan_id') || 0,
    },
  },
  getters: {},
  mutations: {
    setuserInfo(state, userInfo) {
      state.userInfo = Object.assign({}, state.userInfo, userInfo)
      uni.setStorageSync('userInfo', state.userInfo)
    },
    setPlanID(state, id) {
      state.defaultParams.plan_id = id ? id : 0
    },
  },
  actions: {},
}
